<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="java,">










<meta name="description" content="Jdk8到jdk11 Springboot 踩坑指南2018-11-10                  由于打算在项目中使用一些 java9 的特性,而 oracle 官方是从 java8 直接就到 java11 ,所以决定直接升级到java11. 整个过程最关键的是注意当前环境变量,下面开始: 下载jdk11 去oracle官网下载对应你系统的jdk,这个页面:  https://www.o">
<meta name="keywords" content="java">
<meta property="og:type" content="article">
<meta property="og:title" content="Jdk8到jdk11 Springboot 踩坑指南">
<meta property="og:url" content="https://blog.xiezc.xyz/2019/01/17/java/Jdk8到jdk11 Springboot 踩坑指南/index.html">
<meta property="og:site_name" content="xiezc的小站">
<meta property="og:description" content="Jdk8到jdk11 Springboot 踩坑指南2018-11-10                  由于打算在项目中使用一些 java9 的特性,而 oracle 官方是从 java8 直接就到 java11 ,所以决定直接升级到java11. 整个过程最关键的是注意当前环境变量,下面开始: 下载jdk11 去oracle官网下载对应你系统的jdk,这个页面:  https://www.o">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/mvn-v.right.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-1.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-2.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-3.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-4.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-5.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-6.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-7.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-8.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-switch-boot.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/idea-switch-boot2.png">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/want-die.jpg">
<meta property="og:image" content="https://sargeraswang.com/images/blog_img/java8-java11/java9-mapof.png">
<meta property="og:updated_time" content="2019-04-04T14:21:52.528Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Jdk8到jdk11 Springboot 踩坑指南">
<meta name="twitter:description" content="Jdk8到jdk11 Springboot 踩坑指南2018-11-10                  由于打算在项目中使用一些 java9 的特性,而 oracle 官方是从 java8 直接就到 java11 ,所以决定直接升级到java11. 整个过程最关键的是注意当前环境变量,下面开始: 下载jdk11 去oracle官网下载对应你系统的jdk,这个页面:  https://www.o">
<meta name="twitter:image" content="https://sargeraswang.com/images/blog_img/java8-java11/mvn-v.right.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://blog.xiezc.xyz/2019/01/17/java/Jdk8到jdk11 Springboot 踩坑指南/">





  <title>Jdk8到jdk11 Springboot 踩坑指南 | xiezc的小站</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?8ae02d8cf311eabbae2621ff2d51a260";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">xiezc的小站</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">xiezc的小站</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://blog.xiezc.xyz/2019/01/17/java/Jdk8到jdk11 Springboot 踩坑指南/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="xiezc">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="xiezc的小站">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Jdk8到jdk11 Springboot 踩坑指南</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-01-17T15:40:00+08:00">
                2019-01-17
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/java/" itemprop="url" rel="index">
                    <span itemprop="name">java</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          
             <span id="/2019/01/17/java/Jdk8到jdk11 Springboot 踩坑指南/" class="leancloud_visitors" data-flag-title="Jdk8到jdk11 Springboot 踩坑指南">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数&#58;</span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="Jdk8到jdk11-Springboot-踩坑指南"><a href="#Jdk8到jdk11-Springboot-踩坑指南" class="headerlink" title="Jdk8到jdk11 Springboot 踩坑指南"></a>Jdk8到jdk11 Springboot 踩坑指南</h2><p>2018-11-10                 </p>
<p>由于打算在项目中使用一些 java9 的特性,而 oracle 官方是从 java8 直接就到 java11 ,所以决定直接升级到java11.</p>
<p>整个过程<strong>最关键的是注意当前环境变量</strong>,下面开始:</p>
<h3 id="下载jdk11"><a href="#下载jdk11" class="headerlink" title="下载jdk11"></a>下载jdk11</h3><ul>
<li>去<code>oracle</code>官网下载对应你系统的jdk,这个页面:</li>
</ul>
<p><a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html" target="_blank" rel="noopener">https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html</a></p>
<ul>
<li>安装之后,修改环境变量<code>JAVA_HOME</code></li>
<li>确保执行<code>java -version</code>看到的版本是11 —这里很重要</li>
</ul>
<h3 id="下载安装3-5-0以上的maven"><a href="#下载安装3-5-0以上的maven" class="headerlink" title="下载安装3.5.0以上的maven"></a>下载安装3.5.0以上的maven</h3><ul>
<li>去<code>maven</code>官网下载最新的3.6.0版本,这个页面:</li>
</ul>
<p><a href="https://maven.apache.org/download.cgi" target="_blank" rel="noopener">https://maven.apache.org/download.cgi</a></p>
<ul>
<li>解压到合适的目录后,修改环境变量<code>MAVEN_HOME</code></li>
<li>确保执行<code>mvn -v</code>看到的是<code>maven 3.6.0</code>并且 <code>java 11</code>  —这里很重要</li>
<li>如下截图:</li>
</ul>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/mvn-v.right.png" alt="img"></p>
<ul>
<li>只要maven或者java版本显示不正确,就考虑环境变量生效的问题,例如我的MAC,我改了<code>~/.bash_profile</code>但是很奇怪不生效,才想起来自己用的是<code>zsh</code>,又去改了<code>~/.zshrc</code>才生效,改完记得用<code>source</code>命令才可以立即生效</li>
<li>实在无解就重启下试试</li>
</ul>
<h3 id="修改pom-xml"><a href="#修改pom-xml" class="headerlink" title="修改pom.xml"></a>修改pom.xml</h3><ul>
<li><p><code>spring boot parent</code>版本更新到 <code>2.1.0</code></p>
</li>
<li><p><code>java.version</code>修改为11</p>
</li>
</ul>
<p>只要改这两处就ok了,不用看别的教程里还需要增加或修改<code>&lt;plugins&gt;</code>内容,这坑我已经踩过了,不需要的.</p>
<h3 id="阶段性尝试"><a href="#阶段性尝试" class="headerlink" title="阶段性尝试"></a>阶段性尝试</h3><ul>
<li>前面步骤做完,到目前,在终端下,应该已经可以正常打包了</li>
<li><code>cd</code>到项目目录下,执行<code>mvn clean package</code>试试看</li>
<li>没有报错就ok了,继续往下进行IDE的配置</li>
</ul>
<h3 id="IntelliJ-IDEA-的配置"><a href="#IntelliJ-IDEA-的配置" class="headerlink" title="IntelliJ IDEA 的配置"></a>IntelliJ IDEA 的配置</h3><p>这里才是巨坑的.</p>
<ul>
<li>在项目根目录上右键,选择<code>Open Module Settings</code></li>
<li>需要配置<code>jdk</code>的地方如下几张截图</li>
</ul>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-1.png" alt="img"></p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-2.png" alt="img"></p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-3.png" alt="img"></p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-4.png" alt="img"></p>
<p>如果有漏配呢,就会有类似这样的输出:</p>
<p>如下图:</p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-5.png" alt="img"></p>
<ul>
<li>配置好之后点击<code>OK</code>关闭,然后按下<code>command+,</code>打开<code>Preferences</code>界面,左侧搜索输入<code>maven</code>,需要配置的地方如下几张截图</li>
</ul>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-6.png" alt="img"></p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-7.png" alt="img"></p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-setting-8.png" alt="img"></p>
<p>如果有漏配呢,就会有类似这样的输出:</p>
<p>或者是<code>Fatal error compiling: 无效的标记: --release</code></p>
<p>这个<code>Fatal error compiling: 无效的目标发行版: 11</code>坑的突破天际!</p>
<h3 id="别的问题-mybatis警告"><a href="#别的问题-mybatis警告" class="headerlink" title="别的问题:mybatis警告"></a>别的问题:mybatis警告</h3><ul>
<li>如果你的项目使用了<code>mybatis</code>,那可能会在启动时看到如下日志</li>
</ul>
<p>这个问题mybatis团队在修复了,<code>3.5.0</code>中应该能修复,但目前还没有release,所以暂时先忍着吧,详情见github答复: <a href="https://github.com/mybatis/mybatis-3/issues/1156" target="_blank" rel="noopener">MyBatis and JDK 9: Illegal reflective access</a></p>
<h3 id="别的问题-Unable-to-import-maven-project-See-logs-for-details"><a href="#别的问题-Unable-to-import-maven-project-See-logs-for-details" class="headerlink" title="别的问题:Unable to import maven project: See logs for details"></a>别的问题:Unable to import maven project: See logs for details</h3><p>当你对pom.xml 做修改保存,IDEA右下角会有提示 <code>Unable to import maven project: See logs for details</code>,提示让我们去看日志.</p>
<p>点击[Help]–&gt;[Show Log in Finder],可以看到错误信息如下:</p>
<p>关键是其中的 <code>com.intellij.execution.ExecutionException: Unrecognized option: -d64</code>,这是由于<code>-d64</code>在java10中已经被移除了.</p>
<h5 id="下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好"><a href="#下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好" class="headerlink" title="下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好."></a>下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好.</h5><h5 id="下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好-1"><a href="#下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好-1" class="headerlink" title="下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好."></a>下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好.</h5><h5 id="下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好-2"><a href="#下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好-2" class="headerlink" title="下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好."></a>下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好.</h5><ul>
<li>我们先修改IDEA使用java11.</li>
</ul>
<p>修改方法:点击[Help]–&gt;[Find Action…]–&gt;输入[Switch],选中[Switch Boot JDK …],选择jdk11,点击[Save and restart],如下图所示:</p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-switch-boot.png" alt="img"></p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/idea-switch-boot2.png" alt="img"></p>
<p>重启完成,发现问题依旧,怀疑是这个<code>-d64</code>在项目中有配置,搜索后并没有发现.</p>
<ul>
<li>试一下删除IDEA的缓存文件夹,目录在<code>~/Library/Caches/产品名称(比方说我的是IntelliJIdea2018.2)</code>,病情没有好转 .</li>
<li>删除掉配置信息:<code>rm -rf ~/Library/Preferences/IntelliJIdea*</code></li>
</ul>
<p>然后,奇迹发生了,重置之后的IDEA已经无法导入我的项目了,生无可恋…</p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/want-die.jpg" alt="img"></p>
<p>再仔细看下日志,发现后面几行:</p>
<ul>
<li>好,按照官方所说,修改一下IDEA的启动jdk,在 <code>~/Library/Preferences/IntelliJIdea2018.2</code>下创建一个<code>idea.jdk</code>文件,内容是<code>/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk</code></li>
</ul>
<p>再启动加载项目试试,日志中虽然jdk版本是11了,可是依旧报错.绝望中,google到这么一个网页,里面也是同样的问题,答复是:</p>
<p>What ? 2018.3目前还是EAP版本,下载一个试试吧 <a href="https://www.jetbrains.com/idea/nextversion/" target="_blank" rel="noopener">https://www.jetbrains.com/idea/nextversion/</a></p>
<p>下载完成打开拖拽到<code>应用程序</code>,运行<code>IntelliJ IDEA 2018.3 EAP.app</code>,导入我的项目,惊喜来了,成功了!!!<code>JetBrains</code>诚不欺我!</p>
<h3 id="总结就是-解决"><a href="#总结就是-解决" class="headerlink" title="总结就是:解决"></a>总结就是:解决</h3><p><code>com.intellij.execution.ExecutionException: Unrecognized option: -d64</code></p>
<h3 id="办法就是使用2018-3及更新版本"><a href="#办法就是使用2018-3及更新版本" class="headerlink" title="办法就是使用2018.3及更新版本."></a>办法就是使用<code>2018.3</code>及更新版本.</h3><h3 id="完成"><a href="#完成" class="headerlink" title="完成"></a>完成</h3><p>至此,坑已踩完,可以愉快的使用java11开发啦,比方说使用<code>Map.of</code>来快速的创建<code>Map</code>.</p>
<p><img src="https://sargeraswang.com/images/blog_img/java8-java11/java9-mapof.png" alt="img"></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/java/" rel="tag"># java</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/12/07/前端/js前端解析mardown文件/" rel="next" title="js解析markdown文件">
                <i class="fa fa-chevron-left"></i> js解析markdown文件
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/01/22/java/guava的eventBus时间总线/" rel="prev" title="guava的eventBus时间总线">
                guava的eventBus时间总线 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">xiezc</p>
              <p class="site-description motion-element" itemprop="description">主要一些技术文章, 有些文章是转载的</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">72</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                
                  <span class="site-state-item-count">1</span>
                  <span class="site-state-item-name">分类</span>
                
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                
                  <span class="site-state-item-count">20</span>
                  <span class="site-state-item-name">标签</span>
                
              </div>
            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#Jdk8到jdk11-Springboot-踩坑指南"><span class="nav-number">1.</span> <span class="nav-text">Jdk8到jdk11 Springboot 踩坑指南</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#下载jdk11"><span class="nav-number">1.1.</span> <span class="nav-text">下载jdk11</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#下载安装3-5-0以上的maven"><span class="nav-number">1.2.</span> <span class="nav-text">下载安装3.5.0以上的maven</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#修改pom-xml"><span class="nav-number">1.3.</span> <span class="nav-text">修改pom.xml</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#阶段性尝试"><span class="nav-number">1.4.</span> <span class="nav-text">阶段性尝试</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#IntelliJ-IDEA-的配置"><span class="nav-number">1.5.</span> <span class="nav-text">IntelliJ IDEA 的配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#别的问题-mybatis警告"><span class="nav-number">1.6.</span> <span class="nav-text">别的问题:mybatis警告</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#别的问题-Unable-to-import-maven-project-See-logs-for-details"><span class="nav-number">1.7.</span> <span class="nav-text">别的问题:Unable to import maven project: See logs for details</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好"><span class="nav-number">1.7.0.1.</span> <span class="nav-text">下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好.</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好-1"><span class="nav-number">1.7.0.2.</span> <span class="nav-text">下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好.</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#下面关于这个问题的解决步骤-不要照着做-直接看最后的正确解决办法就好-2"><span class="nav-number">1.7.0.3.</span> <span class="nav-text">下面关于这个问题的解决步骤,不要照着做,直接看最后的正确解决办法就好.</span></a></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#总结就是-解决"><span class="nav-number">1.8.</span> <span class="nav-text">总结就是:解决</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#办法就是使用2018-3及更新版本"><span class="nav-number">1.9.</span> <span class="nav-text">办法就是使用2018.3及更新版本.</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#完成"><span class="nav-number">1.10.</span> <span class="nav-text">完成</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xiezc</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("eRAHvO0xVYwckgdXIVpfugRG-gzGzoHsz", "57lKp708hde92YeG1xX9MQj1");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

</body>
</html>
